var BoardUtil = {
  getHideColumns: function (tableName) {
    return ajaxRequest('tableCoucmnlConfig/getConfigByName', {
      tableName: tableName
    }).then(function (config) {
      var tableHideColumnKey;
      if (config === null) {
        tableHideColumnKey = {};
      } else {
        var hideColumn = config.hideColumn;
        if (SysUtil.isEmpty(hideColumn)) {
          tableHideColumnKey = {};
        } else {
          tableHideColumnKey = JSON.parse(hideColumn);
        }
      }
      return tableHideColumnKey;
    });
  },

  saveHideColumns: function (tableName, hideColumns) {
    var postData = {
      columns: hideColumns
    };

    return ajaxRequest('tableCoucmnlConfig/saveConfig', {
      tableName: tableName,
      hideColumn: JSON.stringify(postData)
    }).then(function (msg) {
      return msg;
    });
  }
};
